#include "Menu.h"
#include <iostream>
#include <fstream> // BA A3
//additional includes


using namespace std;

Menu::Menu()
{
}

void Menu::display_main_menu() const 
{
	cout << "\nHere is the MAIN MENU\n"; // BA A3
	cout << " Type 1 for Info\n";  // BA A3
	cout << " Type 2 for Read\n";  // BA A3
	cout << " Type 3 for Show\n";  // BA A3
	cout << " Type 4 for Find\n";  // BA A3
	cout << " Type 5 for Update\n";  // BA A3
	cout << " Type 6 for Exit\n\n";  // BA A3
}
void Menu::display_info() const
{
	cout << "Here is the Info requested \n";//display Project Part I, team name and team members
}

void Menu::read()
{
	cout << "Read file name then read store data \n";
	ifstream catprd("../Sample_Data/catprd.dat");    // BA A3
	
	int numcat;    // BA A3
	catprd >> numcat;    // BA A3
	for (int i=0; i<numcat; ++i) // BA A3
	{
		int catid; // BA A3
		string catname; // BA A3
		catprd >> catid >> catname; // BA A3

		Category c(catid, catname);// BA A3

		cats.push_back(c); // BA A3
	}

	int numprod; // BA A3
	catprd >> numprod; // BA A3
	for ( int i=0; i < numprod; ++i) // BA A3
	{
		int prodid; // BA A3
		int catid; // BA A3
		string prodname; // BA A3
		double prodprice; // BA A3
		catprd >> prodid >> catid >> prodname >> prodprice; // BA A3

		Product a(prodid, catid, prodname, prodprice); // BA A3

		prods.push_back(a); // BA A3
	}
}
void Menu::show() const 
{
	cout << "Show queries \n";
		
}
void Menu::find() const 
{
	cout << "Find queries \n";
}
void Menu::update()  
{
	cout << "Update queries \n";
}